<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="format-detection" content="telephone=no"/>
<meta name="wap-font-scale" content="no">
<meta name="renderer" content="webkit">
<title>AutoCode</title>
<link rel="shortcut icon" href="/favicon.ico" />
<script src="/links/jquery/jquery-3.5.1.min.js"></script>
<script src="/links/polyfill.min.js"></script>
<script src="/links/axios/axios.min.js"></script>
<script src="/links/vue/vue.min.js"></script>
<script src="/links/element-ui/index.js"></script>
<script src="/links/dayjs.min.js"></script>
<script src="/links/echarts/echarts.js"></script>
<script src="/links/JsBarcode.all.js"></script>
<script src="/links/qrcode.min.js"></script>
<script src="/links/layer/layer.js"></script>
<script src="/links/crypto/crypto-js.js"></script>
<script src="/js/dragController.js"></script>
<script src="/js/HttpApi.js"></script>
<script src="/js/AutoCode.js"></script>
<link href="/links/element-ui/theme/index.css" rel="stylesheet"/>
<link href="/css/default.css" rel="stylesheet"/>
<link href="/css/dragController.css" rel="stylesheet"/>
    
    <style>
        .el-transfer-panel{
    width: 300px;
}
    </style>
</head>
<body>
<div id="app"  class="box " >
<div class="topBox " style="height:280px;">
<div class="flex ac-table-head" style="justify-content:flex-start;">
    <div class="ac-table-title">{{workflow.title}}</div>
    <div class="ac-table-oper"><el-form :inline="true" label-position="left" :model="workflow.operData" size="mini" class="searchForm" @submit.native.prevent="workflow_load">
<el-form-item v-if="workflow.operVisible.keyWord"><el-input type="text" v-model="workflow.operData.keyWord" clearable placeholder="流程代码/名称"  @keyup.enter.native="workflow_load"></el-input>
</el-form-item>
<el-form-item v-if="workflow.operVisible.buttonQ"><el-button size="medium"  v-if="workflow.operVisible.buttonQ" @click="workflow_load()" :disabled="workflow.operDisabled.buttonQ"  type="text"     native-type="button">搜索(Q)</el-button>
</el-form-item>
<el-form-item v-if="workflow.operVisible.buttonA"><el-button size="medium"  v-if="workflow.operVisible.buttonA" @click="workflow_openWorkflowAdd()" :disabled="workflow.operDisabled.buttonA"  type="text"     native-type="button">添加(A)</el-button>
</el-form-item>
<el-form-item v-if="workflow.operVisible.buttonE"><el-button size="medium"  v-if="workflow.operVisible.buttonE" @click="workflow_editWorkflowAdd()" :disabled="workflow.operDisabled.buttonE"  type="text"     native-type="button">编辑(E)</el-button>
</el-form-item>
<el-form-item v-if="workflow.operVisible.buttonD"><el-button size="medium"  v-if="workflow.operVisible.buttonD" @click="workflow_delete()" :disabled="workflow.operDisabled.buttonD"  type="text"     native-type="button">删除(D)</el-button>
</el-form-item>
<el-form-item v-if="workflow.operVisible.edit"><el-button size="medium"  v-if="workflow.operVisible.edit" @click="workflow_editWorkflowAdd1()" :disabled="workflow.operDisabled.edit"  type="text"     native-type="button">复制(C)</el-button>
</el-form-item>

</el-form>
</div>
</div>
<div class="ac-table-content">
    <el-table row-key="id" highlight-current-row stripe show-header    border  
    :data="workflow.data" size="mini" ref="workflow"
       
    height="100%"
    @current-change="workflow_currentChange">
    <el-table-column type="index" width="50" label="序号"></el-table-column>
<el-table-column prop="wfCode" label="工作流代码"    align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        {{scope.row.wfCode}}
   </template>
</el-table-column>
<el-table-column prop="label" label="工作流名称"    align="left"   >
   <template slot-scope="scope">
        {{scope.row.label}}
   </template>
</el-table-column>
<el-table-column prop="busiTable" label="业务表"    align="left"   >
   <template slot-scope="scope">
        {{scope.row.busiTable}}
   </template>
</el-table-column>
<el-table-column prop="statusField" label="状态字段"    align="left"   >
   <template slot-scope="scope">
        {{scope.row.statusField}}
   </template>
</el-table-column>
<el-table-column prop="rejectField" label="退回字段"    align="left"   >
   <template slot-scope="scope">
        {{scope.row.rejectField}}
   </template>
</el-table-column>
<el-table-column prop="approveView" label="审批页面"    align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        {{scope.row.approveView}}
   </template>
</el-table-column>
<el-table-column prop="detailView" label="详情页面"    align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        {{scope.row.detailView}}
   </template>
</el-table-column>
<el-table-column prop="preAuth" label="预授权"    align="center"   class-name="editorCell">
   <template slot-scope="scope">
        <el-checkbox  v-model="scope.row.preAuth"  size="small"  true-label="Y"  false-label="N"  @change="workflow_change('preAuth',scope.row)"></el-checkbox>

   </template>
</el-table-column>

</el-table>

</div>

          
</div>
<div class="move"></div>
<div class="downBox " style="height:calc(100% - 282px);">
<div class="box"><div class="left " style="width:700px;">
<div class="flex ac-table-head" style="justify-content:flex-start;">
    <div class="ac-table-title">{{workflowStep.title}}</div>
    <div class="ac-table-oper"><el-button size="medium"  v-if="workflowStep.operVisible.buttonA" @click="workflowStep_openWorkflowStepAdd()" :disabled="workflowStep.operDisabled.buttonA"  type="text"     native-type="button">添加(A)</el-button>
<el-button size="medium"  v-if="workflowStep.operVisible.buttonE" @click="workflowStep_editWorkflowStepAdd()" :disabled="workflowStep.operDisabled.buttonE"  type="text"     native-type="button">编辑(E)</el-button>
<el-button size="medium"  v-if="workflowStep.operVisible.buttonD" @click="workflowStep_delete()" :disabled="workflowStep.operDisabled.buttonD"  type="text"     native-type="button">删除(D)</el-button>
<el-button size="medium"  v-if="workflowStep.operVisible.buttonQ" @click="workflowStep_load()" :disabled="workflowStep.operDisabled.buttonQ"  type="text"     native-type="button">刷新(Q)</el-button>
</div>
</div>
<div class="ac-table-content">
    <el-table row-key="id" highlight-current-row stripe show-header    border  
    :data="workflowStep.data" size="mini" ref="workflowStep"
       
    height="100%"
    @current-change="workflowStep_currentChange">
    <el-table-column prop="sortNo" label="序号" width="70"   align="left" sortable  class-name="editorCell">
   <template slot-scope="scope">
        <el-input-number size="small" v-model="scope.row.sortNo"       :controls="false"  @change="workflowStep_change('sortNo',scope.row)"></el-input-number>

   </template>
</el-table-column>
<el-table-column prop="stepCode" label="步骤代码"    align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        {{scope.row.stepCode}}
   </template>
</el-table-column>
<el-table-column prop="stepName" label="步骤名称"    align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        {{scope.row.stepName}}
   </template>
</el-table-column>
<el-table-column prop="auditOrgan" label="审批机构"  min-width="100"  align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        <template v-for="dict in customOptions.organDict" v-if="scope.row.auditOrgan==dict.value"><i :style="{color:dict.iconColor}" :class="dict.icon"></i> <label :style="{color:dict.fontColor}">{{dict.label}}</label></template>
   </template>
</el-table-column>
<el-table-column prop="auditType" label="审批人"    align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        <template v-for="dict in customOptions.wfAuthType" v-if="scope.row.auditType==dict.value"><i :style="{color:dict.iconColor}" :class="dict.icon"></i> <label :style="{color:dict.fontColor}">{{dict.label}}</label></template>
   </template>
</el-table-column>
<el-table-column prop="esigPassword" label="密码验证"    align="center"   class-name="editorCell">
   <template slot-scope="scope">
        <el-checkbox  v-model="scope.row.esigPassword"  size="small"  true-label="Y"  false-label="N"  @change="workflowStep_change('esigPassword',scope.row)"></el-checkbox>

   </template>
</el-table-column>
<el-table-column prop="multiaudit" label="会签"    align="center"   class-name="editorCell">
   <template slot-scope="scope">
        <el-checkbox  v-model="scope.row.multiaudit"  size="small"  true-label="Y"  false-label="N"  @change="workflowStep_change('multiaudit',scope.row)"></el-checkbox>

   </template>
</el-table-column>
<el-table-column prop="endStep" label="流程结束"    align="center"   class-name="editorCell">
   <template slot-scope="scope">
        <el-checkbox  v-model="scope.row.endStep"  size="small"  true-label="Y"  false-label="N"  @change="workflowStep_change('endStep',scope.row)"></el-checkbox>

   </template>
</el-table-column>

</el-table>

</div>

          
</div>
<div class="resize"></div>
<div class="right " style="width:calc(100% - 702px);">
<el-tabs type="border-card" v-model="page.tabs" class=""  >
<el-tab-pane class="" label="执行操作" name="tab1" :disabled="tabDisabled.tab1" v-if="tabVisible.tab1" >
<div class="box"><div class="topBox " style="height:200px;">
<div class="flex ac-table-head" style="justify-content:flex-start;">
    <div class="ac-table-title">{{workflowStepActions.title}}</div>
    <div class="ac-table-oper"><el-button size="medium"  v-if="workflowStepActions.operVisible.buttonA" @click="workflowStepActions_openWorkflowActionAdd()" :disabled="workflowStepActions.operDisabled.buttonA"  type="text"     native-type="button">添加(A)</el-button>
<el-button size="medium"  v-if="workflowStepActions.operVisible.buttonD" @click="workflowStepActions_delete()" :disabled="workflowStepActions.operDisabled.buttonD"  type="text"     native-type="button">删除(D)</el-button>
<el-button size="medium"  v-if="workflowStepActions.operVisible.C" @click="workflowStepActions_defaultAction()" :disabled="workflowStepActions.operDisabled.C"  type="text"     native-type="button">默认操作</el-button>
</div>
</div>
<div class="ac-table-content">
    <el-table row-key="id" highlight-current-row stripe show-header    border  
    :data="workflowStepActions.data" size="mini" ref="workflowStepActions"
       
    height="100%"
    @current-change="workflowStepActions_currentChange">
    <el-table-column prop="sortNo" label="序号" width="70"   align="left" sortable  class-name="editorCell">
   <template slot-scope="scope">
        <el-input-number size="small" v-model="scope.row.sortNo"       :controls="false"  @change="workflowStepActions_change('sortNo',scope.row)"></el-input-number>

   </template>
</el-table-column>
<el-table-column prop="actionCode" label="动作代码"    align="left"   >
   <template slot-scope="scope">
        {{scope.row.actionCode}}
   </template>
</el-table-column>
<el-table-column prop="actionName" label="动作名称"    align="left"   class-name="editorCell">
   <template slot-scope="scope">
        <el-input size="mini" type="text" v-model="scope.row.actionName"  @change="workflowStepActions_change('actionName',scope.row)"></el-input>

   </template>
</el-table-column>
<el-table-column prop="toStepcode" label="下一步代码"    align="left"   class-name="editorCell">
   <template slot-scope="scope">
        <el-input size="mini" type="text" v-model="scope.row.toStepcode"  @change="workflowStepActions_change('toStepcode',scope.row)"></el-input>

   </template>
</el-table-column>
<el-table-column prop="requireComment" label="原因必填" width="70"   align="center"   class-name="editorCell">
   <template slot-scope="scope">
        <el-checkbox  v-model="scope.row.requireComment"  size="small"  true-label="Y"  false-label="N"  @change="workflowStepActions_change('requireComment',scope.row)"></el-checkbox>

   </template>
</el-table-column>
<el-table-column prop="isreject" label="退回" width="60"   align="center"   class-name="editorCell">
   <template slot-scope="scope">
        <el-checkbox  v-model="scope.row.isreject"  size="small"  true-label="Y"  false-label="N"  @change="workflowStepActions_change('isreject',scope.row)"></el-checkbox>

   </template>
</el-table-column>

</el-table>

</div>

          
</div>
<div class="move"></div>
<div class="downBox " style="height:calc(100% - 202px);">
<div class="flex ac-table-head" style="justify-content:flex-start;">
    <div class="ac-table-title">{{wfStepActionRule.title}}</div>
    <div class="ac-table-oper"><el-button size="medium"  v-if="wfStepActionRule.operVisible.add" @click="wfStepActionRule_openWfActionRuleAdd()" :disabled="wfStepActionRule.operDisabled.add"  type="text"     native-type="button">添加(A)</el-button>
<el-button size="medium"  v-if="wfStepActionRule.operVisible.edit" @click="wfStepActionRule_editWfActionRuleAdd()" :disabled="wfStepActionRule.operDisabled.edit"  type="text"     native-type="button">编辑(E)</el-button>
<el-button size="medium"  v-if="wfStepActionRule.operVisible.del" @click="wfStepActionRule_delete()" :disabled="wfStepActionRule.operDisabled.del"  type="text"     native-type="button">删除(D)</el-button>
<el-button size="medium"  v-if="wfStepActionRule.operVisible.C" @click="wfStepActionRule_editWfActionRuleDetail()" :disabled="wfStepActionRule.operDisabled.C"  type="text"     native-type="button">规则详情</el-button>
</div>
</div>
<div class="ac-table-content">
    <el-table row-key="id" highlight-current-row stripe show-header    border  
    :data="wfStepActionRule.data" size="mini" ref="wfStepActionRule"
       
    height="100%"
    @current-change="wfStepActionRule_currentChange">
    <el-table-column prop="sortNo" label="序号" width="70"   align="left" sortable show-overflow-tooltip >
   <template slot-scope="scope">
        {{scope.row.sortNo}}
   </template>
</el-table-column>
<el-table-column prop="ruleName" label="规则名称"    align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        {{scope.row.ruleName}}
   </template>
</el-table-column>
<el-table-column prop="toStepcode" label="下一步骤代码"    align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        {{scope.row.toStepcode}}
   </template>
</el-table-column>
<el-table-column prop="remark" label="备注"    align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        {{scope.row.remark}}
   </template>
</el-table-column>

</el-table>

</div>

          
</div>
</div>
</el-tab-pane>
<el-tab-pane class="" label="审批人员/角色" name="tab3" :disabled="tabDisabled.tab3" v-if="tabVisible.tab3" >
<div class="flex ac-table-head">
    <div class="ac-table-oper"><el-button size="medium"  v-if="workflowStepUser.operVisible.editRole" @click="workflowStepUser_editWfStepRoleEdit()" :disabled="workflowStepUser.operDisabled.editRole"  type="text"     native-type="button">设置审批角色(A)</el-button>
<el-button size="medium"  v-if="workflowStepUser.operVisible.buttonE" @click="workflowStepUser_editWorkflowStepUserEdit()" :disabled="workflowStepUser.operDisabled.buttonE"  type="text"     native-type="button">设置审批人员(E)</el-button>
<el-button size="medium"  v-if="workflowStepUser.operVisible.edit" @click="workflowStepUser_editWfStepUgroupEdit()" :disabled="workflowStepUser.operDisabled.edit"  type="text"     native-type="button">设置审批小组(E)</el-button>
</div>
    <div></div>
</div>
<div class="ac-table-content">
    <el-table row-key="id" highlight-current-row stripe show-header    border  
    :data="workflowStepUser.data" size="mini" ref="workflowStepUser"
       
    height="100%"
    @current-change="workflowStepUser_currentChange">
    <el-table-column type="index" width="50" label="序号"></el-table-column>
<el-table-column prop="auditType" label="审批类型"    align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        <template v-if="scope.row.auditType=='user'">人员审批</template><template v-else-if="scope.row.auditType=='role'">角色审批</template><template v-else-if="scope.row.auditType=='ugroup'">小组审批</template><template v-else>{{scope.row.auditType}}</template>
   </template>
</el-table-column>
<el-table-column prop="fullname" label="人员/角色"    align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        {{scope.row.fullname}}
   </template>
</el-table-column>
<el-table-column prop="username" label="人员账号"    align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        {{scope.row.username}}
   </template>
</el-table-column>

</el-table>

</div>
          
</el-tab-pane>

</el-tabs>

</div>
</div>
</div>

<el-dialog :visible.sync="wfActionRuleDetail.visible" :title="wfActionRuleDetail.title"
            width="50%"
                
            :close-on-click-modal="false"
            :close-on-press-escape="false">
            <div style="width:100%;height:300px;">
                <div class="flex ac-table-head">
    <div class="ac-table-oper"><el-button size="medium"  v-if="wfActionRuleDetail.operVisible.add" @click="wfActionRuleDetail_openWfRuleDetailAdd()" :disabled="wfActionRuleDetail.operDisabled.add"  type="text"     native-type="button">添加(A)</el-button>
<el-button size="medium"  v-if="wfActionRuleDetail.operVisible.del" @click="wfActionRuleDetail_delete()" :disabled="wfActionRuleDetail.operDisabled.del"  type="text"     native-type="button">删除(D)</el-button>
<el-button size="medium"  v-if="wfActionRuleDetail.operVisible.edit" @click="wfActionRuleDetail_editWfRuleDetailAdd()" :disabled="wfActionRuleDetail.operDisabled.edit"  type="text"     native-type="button">编辑(E)</el-button>
</div>
    <div></div>
</div>
<div class="ac-table-content">
    <el-table row-key="id" highlight-current-row stripe show-header    border  
    :data="wfActionRuleDetail.data" size="mini" ref="wfActionRuleDetail"
       
    height="100%"
    @current-change="wfActionRuleDetail_currentChange">
    <el-table-column prop="sortNo" label="序号" width="70"   align="left" sortable show-overflow-tooltip >
   <template slot-scope="scope">
        {{scope.row.sortNo}}
   </template>
</el-table-column>
<el-table-column prop="fieldName" label="字段"    align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        {{scope.row.fieldName}}
   </template>
</el-table-column>
<el-table-column prop="operator" label="比较方式"    align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        <template v-if="scope.row.operator=='='">=</template><template v-else-if="scope.row.operator=='<'">&lt;</template><template v-else-if="scope.row.operator=='<='">&lt;=</template><template v-else-if="scope.row.operator=='>'">&gt;</template><template v-else-if="scope.row.operator=='>='">&gt;=</template><template v-else-if="scope.row.operator=='!='">!=</template><template v-else>{{scope.row.operator}}</template>
   </template>
</el-table-column>
<el-table-column prop="limitValue" label="限定值"    align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        {{scope.row.limitValue}}
   </template>
</el-table-column>
<el-table-column prop="remark" label="备注"    align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        {{scope.row.remark}}
   </template>
</el-table-column>

</el-table>

</div>
          
            </div>
            <div class="dialog-footer" slot="footer">    <el-button size="mini" @click="wfActionRuleDetail_dialogOk()"  type="primary"      native-type="button">确 定</el-button>
    <el-button size="medium" @click="wfActionRuleDetail_dialogCancel()"  type="text"      native-type="button">取 消</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="wfStepUgroupEdit.visible" :title="wfStepUgroupEdit.title"
            width="50%"
                
            :close-on-click-modal="false"
            :close-on-press-escape="false">
            <div style="width:100%;">
                 <el-transfer
    ref="wfStepUgroupEdit"
    v-model="wfStepUgroupEdit.rightData" 
    :data="wfStepUgroupEdit.data" 
    :filterable="false"
     
    :left-default-checked="wfStepUgroupEdit.leftDefaultChecked"
	:right-default-checked="wfStepUgroupEdit.rightDefaultChecked"
	:titles="['用户小组','审批小组']"
    :props='{"key":"id","label":"name"}'>
 </el-transfer>
            </div>
            <div class="dialog-footer" slot="footer">    <el-button size="mini" @click="wfStepUgroupEdit_dialogOk()"  type="primary"      native-type="button">确 定</el-button>
    <el-button size="medium" @click="wfStepUgroupEdit_dialogCancel()"  type="text"      native-type="button">取 消</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="workflowAdd.visible" :title="workflowAdd.title"
            width="50%"
                
            :close-on-click-modal="false"
            :close-on-press-escape="false">
            <div style="width:100%;">
                <el-form class=""    label-width="100px" label-position="right"
     size="mini" ref="workflowAdd" :model="workflowAdd.data" :rules="workflowAdd.rules"  
     :disabled="workflowAdd.disabled" @submit.native.prevent>
    <el-row><el-col :span=24 v-if="workflowAdd.itemVisible.wfCode">
    <el-form-item prop="wfCode" label="工作流代码">
        
<el-input type="text" size="mini"  v-model="workflowAdd.data.wfCode" placeholder="工作流代码" :disabled="workflowAdd.editorForm || workflowAdd.itemDisabled.wfCode"  @keyup.enter.native="workflowAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="workflowAdd.itemVisible.label">
    <el-form-item prop="label" label="工作流名称">
        
<el-input type="text" size="mini"  v-model="workflowAdd.data.label" placeholder="工作流名称" :disabled="workflowAdd.itemDisabled.label"  @keyup.enter.native="workflowAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="workflowAdd.itemVisible.busiTable">
    <el-form-item prop="busiTable" label="业务表">
        
<el-input type="text" size="mini"  v-model="workflowAdd.data.busiTable" placeholder="业务表" :disabled="workflowAdd.itemDisabled.busiTable"  @keyup.enter.native="workflowAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="workflowAdd.itemVisible.statusField">
    <el-form-item prop="statusField" label="状态字段">
        
<el-input type="text" size="mini"  v-model="workflowAdd.data.statusField" placeholder="状态字段" :disabled="workflowAdd.itemDisabled.statusField"  @keyup.enter.native="workflowAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="workflowAdd.itemVisible.rejectField">
    <el-form-item prop="rejectField" label="退回字段">
        
<el-input type="text" size="mini"  v-model="workflowAdd.data.rejectField" placeholder="退回字段" :disabled="workflowAdd.itemDisabled.rejectField"  @keyup.enter.native="workflowAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="workflowAdd.itemVisible.approveView">
    <el-form-item prop="approveView" label="审批页面">
        
<el-input type="text" size="mini"  v-model="workflowAdd.data.approveView" placeholder="审批页面" :disabled="workflowAdd.itemDisabled.approveView"  @keyup.enter.native="workflowAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="workflowAdd.itemVisible.detailView">
    <el-form-item prop="detailView" label="详情页面">
        
<el-input type="text" size="mini"  v-model="workflowAdd.data.detailView" placeholder="详情页面" :disabled="workflowAdd.itemDisabled.detailView"  @keyup.enter.native="workflowAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
</el-row>
 </el-form>

            </div>
            <div class="dialog-footer" slot="footer">    <el-button size="mini" @click="workflowAdd_dialogOk()"  type="primary"      native-type="button">确 定</el-button>
    <el-button size="medium" @click="workflowAdd_dialogCancel()"  type="text"      native-type="button">取 消</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="workflowStepAdd.visible" :title="workflowStepAdd.title"
            width="50%"
                
            :close-on-click-modal="false"
            :close-on-press-escape="false">
            <div style="width:100%;">
                <el-form class=""    label-width="80px" label-position="right"
     size="mini" ref="workflowStepAdd" :model="workflowStepAdd.data" :rules="workflowStepAdd.rules"  
     :disabled="workflowStepAdd.disabled" @submit.native.prevent>
    <el-row><el-col :span=24 v-if="workflowStepAdd.itemVisible.stepCode">
    <el-form-item prop="stepCode" label="步骤代码">
        
<el-input type="text" size="mini"  v-model="workflowStepAdd.data.stepCode" placeholder="步骤代码" :disabled="workflowStepAdd.editorForm || workflowStepAdd.itemDisabled.stepCode"  @keyup.enter.native="workflowStepAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="workflowStepAdd.itemVisible.stepName">
    <el-form-item prop="stepName" label="步骤名称">
        
<el-input type="text" size="mini"  v-model="workflowStepAdd.data.stepName" placeholder="步骤名称" :disabled="workflowStepAdd.itemDisabled.stepName"  @keyup.enter.native="workflowStepAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="workflowStepAdd.itemVisible.auditOrgan">
    <el-form-item prop="auditOrgan" label="审批机构">
        <el-select v-model="workflowStepAdd.data.auditOrgan" style="width:100%;" placeholder="审批机构" size="mini" :disabled="workflowStepAdd.itemDisabled.auditOrgan" clearable      @keyup.enter.native="workflowStepAdd_dialogOk">
   <el-option v-for="dict in customOptions.organDict" :label="dict.label" :value="dict.value"></el-option>
</el-select>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="workflowStepAdd.itemVisible.auditType">
    <el-form-item prop="auditType" label="审批人">
        <el-select v-model="workflowStepAdd.data.auditType" style="width:100%;" placeholder="审批人" size="mini" :disabled="workflowStepAdd.itemDisabled.auditType" clearable      @keyup.enter.native="workflowStepAdd_dialogOk">
   <el-option v-for="dict in customOptions.wfAuthType" :label="dict.label" :value="dict.value"></el-option>
</el-select>

        
    </el-form-item>
</el-col>
<el-col :span=12 v-if="workflowStepAdd.itemVisible.esigPassword">
    <el-form-item prop="esigPassword" label="密码验证">
        <el-checkbox  v-model="workflowStepAdd.data.esigPassword"  size="mini"  true-label="Y"  false-label="N" :disabled="workflowStepAdd.itemDisabled.esigPassword"  @keyup.enter.native="workflowStepAdd_dialogOk"></el-checkbox>

        
    </el-form-item>
</el-col>
<el-col :span=12 v-if="workflowStepAdd.itemVisible.multiaudit">
    <el-form-item prop="multiaudit" label="会签">
        <el-checkbox  v-model="workflowStepAdd.data.multiaudit"  size="mini"  true-label="Y"  false-label="N" :disabled="workflowStepAdd.itemDisabled.multiaudit"  @keyup.enter.native="workflowStepAdd_dialogOk"></el-checkbox>

        
    </el-form-item>
</el-col>
</el-row>
 </el-form>

            </div>
            <div class="dialog-footer" slot="footer">    <el-button size="mini" @click="workflowStepAdd_dialogOk()"  type="primary"      native-type="button">确 定</el-button>
    <el-button size="medium" @click="workflowStepAdd_dialogCancel()"  type="text"      native-type="button">取 消</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="workflowStepUserEdit.visible" :title="workflowStepUserEdit.title"
            width="760px"
                
            :close-on-click-modal="false"
            :close-on-press-escape="false">
            <div style="width:100%;">
                 <el-transfer
    ref="workflowStepUserEdit"
    v-model="workflowStepUserEdit.rightData" 
    :data="workflowStepUserEdit.data" 
    :filterable="true"
     
    :left-default-checked="workflowStepUserEdit.leftDefaultChecked"
	:right-default-checked="workflowStepUserEdit.rightDefaultChecked"
	:titles="['人员列表','审批人']"
    :props='{"key":"username","label":"label"}'>
 </el-transfer>
            </div>
            <div class="dialog-footer" slot="footer">    <el-button size="mini" @click="workflowStepUserEdit_dialogOk()"  type="primary"      native-type="button">确 定</el-button>
    <el-button size="medium" @click="workflowStepUserEdit_dialogCancel()"  type="text"      native-type="button">取 消</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="wfStepRoleEdit.visible" :title="wfStepRoleEdit.title"
            width="800px"
                
            :close-on-click-modal="false"
            :close-on-press-escape="false">
            <div style="width:100%;">
                 <el-transfer
    ref="wfStepRoleEdit"
    v-model="wfStepRoleEdit.rightData" 
    :data="wfStepRoleEdit.data" 
    :filterable="false"
     
    :left-default-checked="wfStepRoleEdit.leftDefaultChecked"
	:right-default-checked="wfStepRoleEdit.rightDefaultChecked"
	:titles="['单位角色','审批角色']"
    :props='{"key":"id","label":"label"}'>
 </el-transfer>
            </div>
            <div class="dialog-footer" slot="footer">    <el-button size="mini" @click="wfStepRoleEdit_dialogOk()"  type="primary"      native-type="button">确 定</el-button>
    <el-button size="medium" @click="wfStepRoleEdit_dialogCancel()"  type="text"      native-type="button">取 消</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="wfFieldAdd.visible" :title="wfFieldAdd.title"
            width="500px"
                
            :close-on-click-modal="false"
            :close-on-press-escape="false">
            <div style="width:100%;">
                <el-form class=""  :show-message="false"  label-width="80px" label-position="right"
     size="mini" ref="wfFieldAdd" :model="wfFieldAdd.data" :rules="wfFieldAdd.rules"  
     :disabled="wfFieldAdd.disabled" @submit.native.prevent>
    <el-row><el-col :span=24 v-if="wfFieldAdd.itemVisible.name">
    <el-form-item prop="name" label="字段标识">
        
<el-input type="text" size="mini"  v-model="wfFieldAdd.data.name" placeholder="字段标识" :disabled="wfFieldAdd.itemDisabled.name"  @keyup.enter.native="wfFieldAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="wfFieldAdd.itemVisible.label">
    <el-form-item prop="label" label="字段名称">
        
<el-input type="text" size="mini"  v-model="wfFieldAdd.data.label" placeholder="字段名称" :disabled="wfFieldAdd.itemDisabled.label"  @keyup.enter.native="wfFieldAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="wfFieldAdd.itemVisible.fieldType">
    <el-form-item prop="fieldType" label="字段类型">
        <el-select v-model="wfFieldAdd.data.fieldType" style="width:100%;" placeholder="字段类型" size="mini" :disabled="wfFieldAdd.itemDisabled.fieldType" clearable      @keyup.enter.native="wfFieldAdd_dialogOk">
   <el-option v-for="dict in dictOptions.fieldType" :label="dict.label" :value="dict.value"></el-option>
</el-select>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="wfFieldAdd.itemVisible.isRequired">
    <el-form-item prop="isRequired" label="必填项">
        <el-checkbox  v-model="wfFieldAdd.data.isRequired"  size="mini"  true-label="Y"  false-label="N" :disabled="wfFieldAdd.itemDisabled.isRequired"  @keyup.enter.native="wfFieldAdd_dialogOk"></el-checkbox>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="wfFieldAdd.itemVisible.remark">
    <el-form-item prop="remark" label="备注">
        <el-input type="textarea" size="mini"  v-model="wfFieldAdd.data.remark" placeholder="备注" :rows="2" :autosize="false" :disabled="wfFieldAdd.itemDisabled.remark" ></el-input>

        
    </el-form-item>
</el-col>
</el-row>
 </el-form>

            </div>
            <div class="dialog-footer" slot="footer">    <el-button size="mini" @click="wfFieldAdd_dialogOk()"  type="primary"      native-type="button">确 定</el-button>
    <el-button size="medium" @click="wfFieldAdd_dialogCancel()"  type="text"      native-type="button">取 消</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="wfFields.visible" :title="wfFields.title"
            width="50%"
              fullscreen  
            :close-on-click-modal="false"
            :close-on-press-escape="false">
            <div style="width:100%;">
                <div class="flex ac-table-head">
    <div class="ac-table-oper"><el-button size="medium"  v-if="wfFields.operVisible.add" @click="wfFields_openWfFieldAdd()" :disabled="wfFields.operDisabled.add"  type="text"     native-type="button">添加(A)</el-button>
<el-button size="medium"  v-if="wfFields.operVisible.edit" @click="wfFields_editWfFieldAdd()" :disabled="wfFields.operDisabled.edit"  type="text"     native-type="button">编辑(E)</el-button>
<el-button size="medium"  v-if="wfFields.operVisible.del" @click="wfFields_delete()" :disabled="wfFields.operDisabled.del"  type="text"     native-type="button">删除(D)</el-button>
</div>
    <div></div>
</div>
<div class="ac-table-content">
    <el-table row-key="id" highlight-current-row stripe show-header    border  
    :data="wfFields.data" size="mini" ref="wfFields"
       
    @current-change="wfFields_currentChange">
    <el-table-column type="selection" width="50" align="center"></el-table-column>
<el-table-column type="index" width="50" label="序号"></el-table-column>
<el-table-column prop="name" label="字段标识"    align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        {{scope.row.name}}
   </template>
</el-table-column>
<el-table-column prop="label" label="字段说明"    align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        {{scope.row.label}}
   </template>
</el-table-column>
<el-table-column prop="fieldType" label="字段类型"    align="left"   >
   <template slot-scope="scope">
        <template v-for="dict in dictOptions.fieldType" v-if="scope.row.fieldType==dict.value"> <i :style="{color:dict.iconColor}" :class="dict.icon"></i> <label :style="{color:dict.fontColor}">{{dict.label}}</label></template>
   </template>
</el-table-column>
<el-table-column prop="isRequired" label="必填项"    align="center"   class-name="editorCell">
   <template slot-scope="scope">
        <el-checkbox  v-model="scope.row.isRequired"  size="small"  true-label="Y"  false-label="N"  @change="wfFields_change('isRequired',scope.row)"></el-checkbox>

   </template>
</el-table-column>
<el-table-column prop="noUpdata" label="禁止更新"    align="center"   class-name="editorCell">
   <template slot-scope="scope">
        <el-checkbox  v-model="scope.row.noUpdata"  size="small"  true-label="Y"  false-label="N"  @change="wfFields_change('noUpdata',scope.row)"></el-checkbox>

   </template>
</el-table-column>
<el-table-column prop="selectShow" label="查询显示"    align="center"   class-name="editorCell">
   <template slot-scope="scope">
        <el-checkbox  v-model="scope.row.selectShow"  size="small"  true-label="Y"  false-label="N"  @change="wfFields_change('selectShow',scope.row)"></el-checkbox>

   </template>
</el-table-column>
<el-table-column prop="keyWord" label="关键字检索"    align="center"   class-name="editorCell">
   <template slot-scope="scope">
        <el-checkbox  v-model="scope.row.keyWord"  size="small"  true-label="Y"  false-label="N"  @change="wfFields_change('keyWord',scope.row)"></el-checkbox>

   </template>
</el-table-column>
<el-table-column prop="remark" label="备注"    align="left"  show-overflow-tooltip >
   <template slot-scope="scope">
        {{scope.row.remark}}
   </template>
</el-table-column>
<el-table-column prop="sortNo" label="排序" width="70"   align="left"   class-name="editorCell">
   <template slot-scope="scope">
        <el-input-number size="small" v-model="scope.row.sortNo"       :controls="false"  @change="wfFields_change('sortNo',scope.row)"></el-input-number>

   </template>
</el-table-column>

</el-table>

</div>
          
            </div>
            
</el-dialog>
<el-dialog :visible.sync="wfRuleDetailAdd.visible" :title="wfRuleDetailAdd.title"
            width="50%"
                
            :close-on-click-modal="false"
            :close-on-press-escape="false">
            <div style="width:100%;">
                <el-form class=""    label-width="80px" label-position="right"
     size="mini" ref="wfRuleDetailAdd" :model="wfRuleDetailAdd.data" :rules="wfRuleDetailAdd.rules"  
     :disabled="wfRuleDetailAdd.disabled" @submit.native.prevent>
    <el-row><el-col :span=24 v-if="wfRuleDetailAdd.itemVisible.sortNo">
    <el-form-item prop="sortNo" label="序号">
        <el-input-number size="mini" v-model="wfRuleDetailAdd.data.sortNo" placeholder="序号"  :disabled="wfRuleDetailAdd.itemDisabled.sortNo"       :controls="false" ></el-input-number>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="wfRuleDetailAdd.itemVisible.fieldName">
    <el-form-item prop="fieldName" label="字段">
        
<el-input type="text" size="mini"  v-model="wfRuleDetailAdd.data.fieldName" placeholder="字段" :disabled="wfRuleDetailAdd.itemDisabled.fieldName"  @keyup.enter.native="wfRuleDetailAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="wfRuleDetailAdd.itemVisible.operator">
    <el-form-item prop="operator" label="比较方式">
        <el-select v-model="wfRuleDetailAdd.data.operator"  placeholder="比较方式" size="mini" :disabled="wfRuleDetailAdd.itemDisabled.operator" clearable      @keyup.enter.native="wfRuleDetailAdd_dialogOk">
   <el-option label="=" value="="></el-option><el-option label="<" value="<"></el-option><el-option label="<=" value="<="></el-option><el-option label=">" value=">"></el-option><el-option label=">=" value=">="></el-option><el-option label="!=" value="!="></el-option>
</el-select>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="wfRuleDetailAdd.itemVisible.limitValue">
    <el-form-item prop="limitValue" label="限定值">
        
<el-input type="text" size="mini"  v-model="wfRuleDetailAdd.data.limitValue" placeholder="限定值" :disabled="wfRuleDetailAdd.itemDisabled.limitValue"  @keyup.enter.native="wfRuleDetailAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="wfRuleDetailAdd.itemVisible.remark">
    <el-form-item prop="remark" label="备注">
        
<el-input type="text" size="mini"  v-model="wfRuleDetailAdd.data.remark" placeholder="备注" :disabled="wfRuleDetailAdd.itemDisabled.remark"  @keyup.enter.native="wfRuleDetailAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
</el-row>
 </el-form>

            </div>
            <div class="dialog-footer" slot="footer">    <el-button size="mini" @click="wfRuleDetailAdd_dialogOk()"  type="primary"      native-type="button">确 定</el-button>
    <el-button size="medium" @click="wfRuleDetailAdd_dialogCancel()"  type="text"      native-type="button">取 消</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="wfActionRuleAdd.visible" :title="wfActionRuleAdd.title"
            width="50%"
                
            :close-on-click-modal="false"
            :close-on-press-escape="false">
            <div style="width:100%;">
                <el-form class=""    label-width="100px" label-position="right"
     size="mini" ref="wfActionRuleAdd" :model="wfActionRuleAdd.data" :rules="wfActionRuleAdd.rules"  
     :disabled="wfActionRuleAdd.disabled" @submit.native.prevent>
    <el-row><el-col :span=24 v-if="wfActionRuleAdd.itemVisible.ruleName">
    <el-form-item prop="ruleName" label="规则名称">
        
<el-input type="text" size="mini"  v-model="wfActionRuleAdd.data.ruleName" placeholder="规则名称" :disabled="wfActionRuleAdd.itemDisabled.ruleName"  @keyup.enter.native="wfActionRuleAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="wfActionRuleAdd.itemVisible.remark">
    <el-form-item prop="remark" label="备注">
        
<el-input type="text" size="mini"  v-model="wfActionRuleAdd.data.remark" placeholder="备注" :disabled="wfActionRuleAdd.itemDisabled.remark"  @keyup.enter.native="wfActionRuleAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="wfActionRuleAdd.itemVisible.toStepcode">
    <el-form-item prop="toStepcode" label="下一步代码">
        
<el-input type="text" size="mini"  v-model="wfActionRuleAdd.data.toStepcode" placeholder="下一步代码" :disabled="wfActionRuleAdd.itemDisabled.toStepcode"  @keyup.enter.native="wfActionRuleAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="wfActionRuleAdd.itemVisible.sortNo">
    <el-form-item prop="sortNo" label="序号">
        <el-input-number size="mini" v-model="wfActionRuleAdd.data.sortNo" placeholder="序号"  :disabled="wfActionRuleAdd.itemDisabled.sortNo"       :controls="false" ></el-input-number>

        
    </el-form-item>
</el-col>
</el-row>
 </el-form>

            </div>
            <div class="dialog-footer" slot="footer">    <el-button size="mini" @click="wfActionRuleAdd_dialogOk()"  type="primary"      native-type="button">确 定</el-button>
    <el-button size="medium" @click="wfActionRuleAdd_dialogCancel()"  type="text"      native-type="button">取 消</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="workflowActionAdd.visible" :title="workflowActionAdd.title"
            width="50%"
                
            :close-on-click-modal="false"
            :close-on-press-escape="false">
            <div style="width:100%;">
                <el-form class=""    label-width="100px" label-position="right"
     size="mini" ref="workflowActionAdd" :model="workflowActionAdd.data" :rules="workflowActionAdd.rules"  
     :disabled="workflowActionAdd.disabled" @submit.native.prevent>
    <el-row><el-col :span=24 v-if="workflowActionAdd.itemVisible.actionCode">
    <el-form-item prop="actionCode" label="动作代码">
        
<el-input type="text" size="mini"  v-model="workflowActionAdd.data.actionCode" placeholder="动作代码" :disabled="workflowActionAdd.itemDisabled.actionCode"  @keyup.enter.native="workflowActionAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="workflowActionAdd.itemVisible.actionName">
    <el-form-item prop="actionName" label="动作名称">
        
<el-input type="text" size="mini"  v-model="workflowActionAdd.data.actionName" placeholder="动作名称" :disabled="workflowActionAdd.itemDisabled.actionName"  @keyup.enter.native="workflowActionAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
<el-col :span=24 v-if="workflowActionAdd.itemVisible.toStepcode">
    <el-form-item prop="toStepcode" label="下一步代码">
        
<el-input type="text" size="mini"  v-model="workflowActionAdd.data.toStepcode" placeholder="下一步代码" :disabled="workflowActionAdd.itemDisabled.toStepcode"  @keyup.enter.native="workflowActionAdd_dialogOk"  ></el-input>

        
    </el-form-item>
</el-col>
</el-row>
 </el-form>

            </div>
            <div class="dialog-footer" slot="footer">    <el-button size="mini" @click="workflowActionAdd_dialogOk()"  type="primary"      native-type="button">确 定</el-button>
    <el-button size="medium" @click="workflowActionAdd_dialogCancel()"  type="text"      native-type="button">取 消</el-button>
</div>
</el-dialog>


</div>

</body>
<script th:inline="javascript">
    let vm = new Vue({
            el: '#app',
            data() {
                return {"workflowStep":{"title":"工作流步骤","currentRow":{},"data":[],"expandRowKeys":[],"pagingData":{},"operData":{},"operVisible":{"buttonA":true,"buttonD":true,"buttonQ":true,"buttonE":true},"operDisabled":{},"rawData":[],"itemVisible":{},"operDialogVisible":false},"workflowStepUser":{"title":"审批人员/角色","currentRow":{},"data":[],"expandRowKeys":[],"pagingData":{},"operData":{},"operVisible":{"buttonE":true,"editRole":true,"edit":true},"operDisabled":{},"rawData":[],"itemVisible":{},"operDialogVisible":false},"workflow":{"title":"工作流","currentRow":{},"data":[],"expandRowKeys":[],"pagingData":{},"operData":{"keyWord":""},"operVisible":{"buttonA":true,"buttonQ":true,"buttonD":true,"buttonE":true,"keyWord":true,"edit":true},"operDisabled":{},"rawData":[],"itemVisible":{},"operDialogVisible":false},"workflowStepActions":{"title":"执行操作","currentRow":{},"data":[],"expandRowKeys":[],"pagingData":{},"operData":{},"operVisible":{"buttonA":true,"buttonD":true,"C":true},"operDisabled":{},"rawData":[],"itemVisible":{},"operDialogVisible":false},"wfStepActionRule":{"title":"操作规则","currentRow":{},"data":[],"expandRowKeys":[],"pagingData":{},"operData":{},"operVisible":{"add":true,"del":true,"C":true,"edit":true},"operDisabled":{},"rawData":[],"itemVisible":{},"operDialogVisible":false},"page":{"tabs":"tab1"},"tabDisabled":{"tab1":false,"tab3":false},"tabVisible":{"tab1":true,"tab3":true},"customOptions":{},"dictOptions":{},"wfActionRuleDetail":{"visible":false,"title":"规则详情","currentRow":{},"data":[],"expandRowKeys":[],"pagingData":{},"operData":{},"operVisible":{"add":true,"del":true,"edit":true},"operDisabled":{},"rawData":[],"itemVisible":{},"operDialogVisible":false},"wfStepUgroupEdit":{"visible":false,"title":"编辑审批小组","data":[],"rightData":[],"rightDefaultChecked":[],"leftDefaultChecked":[],"operData":{},"operVisible":{},"operDisabled":{},"value":[]},"workflowAdd":{"visible":false,"title":"添加工作流","data":{"statusField":"status","rejectField":"reject"},"operData":{},"operVisible":{},"operDisabled":{},"disabled":false,"editorForm":true,"itemVisible":{"wfCode":true,"label":true,"busiTable":true,"statusField":true,"rejectField":true,"detailView":true,"approveView":true},"itemDisabled":{},"transfer":{},"rules":{"wfCode":[{"required":true,"message":"请输入工作流代码","trigger":"blur"}],"label":[{"required":true,"message":"请输入工作流名称","trigger":"blur"}],"busiTable":[{"required":true,"message":"请输入业务表","trigger":"blur"}],"statusField":[{"required":true,"message":"请输入状态字段","trigger":"blur"}]}},"workflowStepAdd":{"visible":false,"title":"添加流程环节","data":{"auditType":"none","auditOrgan":"default"},"operData":{},"operVisible":{},"operDisabled":{},"disabled":false,"editorForm":true,"itemVisible":{"stepCode":true,"esigPassword":true,"stepName":true,"multiaudit":true,"auditType":true,"auditOrgan":true},"itemDisabled":{},"transfer":{},"rules":{"stepCode":[{"required":true,"message":"请输入步骤代码","trigger":"blur"}],"stepName":[{"required":true,"message":"请输入步骤名称","trigger":"blur"}],"auditOrgan":[{"required":true,"message":"请输入审批机构","trigger":"blur"}],"auditType":[{"required":true,"message":"请输入审批人","trigger":"blur"}]}},"workflowStepUserEdit":{"visible":false,"title":"编辑审批人","data":[],"rightData":[],"rightDefaultChecked":[],"leftDefaultChecked":[],"operData":{},"operVisible":{},"operDisabled":{},"value":[]},"wfStepRoleEdit":{"visible":false,"title":"编辑审批角色","data":[],"rightData":[],"rightDefaultChecked":[],"leftDefaultChecked":[],"operData":{},"operVisible":{},"operDisabled":{},"value":[]},"wfFieldAdd":{"visible":false,"title":"表单字段","data":{"isRequired":"N"},"operData":{},"operVisible":{},"operDisabled":{},"disabled":false,"editorForm":true,"itemVisible":{"remark":true,"label":true,"name":true,"fieldType":true,"isRequired":true},"itemDisabled":{},"transfer":{},"rules":{"name":[{"required":true,"message":"请输入字段标识","trigger":"blur"}],"label":[{"required":true,"message":"请输入字段名称","trigger":"blur"}],"fieldType":[{"required":true,"message":"请输入字段类型","trigger":"blur"}]}},"wfFields":{"visible":false,"title":"流程表单","currentRow":{},"data":[],"expandRowKeys":[],"pagingData":{},"operData":{},"operVisible":{"add":true,"edit":true,"del":true},"operDisabled":{},"rawData":[],"itemVisible":{},"operDialogVisible":false},"wfRuleDetailAdd":{"visible":false,"title":"规则详情","data":{"sortNo":0},"operData":{},"operVisible":{},"operDisabled":{},"disabled":false,"editorForm":true,"itemVisible":{"sortNo":true,"remark":true,"fieldName":true,"limitValue":true,"operator":true},"itemDisabled":{},"transfer":{},"rules":{"sortNo":[{"required":true,"message":"请输入序号","trigger":"blur"}],"fieldName":[{"required":true,"message":"请输入字段","trigger":"blur"}],"operator":[{"required":true,"message":"请输入比较方式","trigger":"blur"}],"limitValue":[{"required":true,"message":"请输入限定值","trigger":"blur"}],"remark":[{"required":true,"message":"请输入备注","trigger":"blur"}]}},"wfActionRuleAdd":{"visible":false,"title":"添加规则","data":{"sortNo":0},"operData":{},"operVisible":{},"operDisabled":{},"disabled":false,"editorForm":true,"itemVisible":{"sortNo":true,"remark":true,"ruleName":true,"toStepcode":true},"itemDisabled":{},"transfer":{},"rules":{"ruleName":[{"required":true,"message":"请输入规则名称","trigger":"blur"}],"remark":[{"required":true,"message":"请输入备注","trigger":"blur"}],"toStepcode":[{"required":true,"message":"请输入下一步代码","trigger":"blur"}],"sortNo":[{"required":true,"message":"请输入序号","trigger":"blur"}]}},"workflowActionAdd":{"visible":false,"title":"添加执行步骤","data":{},"operData":{},"operVisible":{},"operDisabled":{},"disabled":false,"editorForm":true,"itemVisible":{"toStepcode":true,"actionName":true,"actionCode":true},"itemDisabled":{},"transfer":{},"rules":{"actionCode":[{"required":true,"message":"请输入动作代码","trigger":"blur"}],"actionName":[{"required":true,"message":"请输入动作名称","trigger":"blur"}],"toStepcode":[{"required":true,"message":"请输入下一步代码","trigger":"blur"}]}}}
            },
            watch: {
},
            methods: {
wfRuleDetailAdd_change:function(fieldName){
    HttpApi.updateProvider("autocodeWfRuleDetail",fieldName,this.wfRuleDetailAdd.data,function(){

    });
},
wfRuleDetailAdd_load:function(){
    let that = this;
    HttpApi.queryObject("autocodeWfRuleDetail",this.wfRuleDetailAdd.operData,function(res){
        that.wfRuleDetailAdd.data = res;
    });
},
wfActionRuleAdd_dialogCancel:function(){
     this.wfActionRuleAdd.visible = false;
},
wfStepActionRule_operCtrl:function(currentRow) {
    /**
    * operDisabled：控制按钮的是否禁止操作，true代表禁止操作，false代表允许操作
    * this.$set(this.stdSolReceiveHistory.operDisabled, "buttonE", true);
    * operVisible：控制按钮是否显示，true代表显示，false代表不显示
    * this.$set(this.stdSolReceiveHistory.operVisible, "buttonE", false);
    */
    if(!currentRow) {
       
    }else {
       
    }
},
workflowStep_delete: function(){
    let that = this;
    let id=this.workflowStep.currentRow.id;
    if(id){
        HttpApi.delProviderConfirm("autocodeWfStep", this.workflowStep.currentRow,function(res){
            let index = that.workflowStep.data.findIndex(function(item){
                return item.id==id;
            });
            
            that.workflowStep.data.splice(index,1);
            if(that.workflowStep.data.length==0){
                that.$data.workflowStep.currentRow = that.$options.data().workflowStep.currentRow;
                that.$refs.workflowStep.setCurrentRow();
            }else if(that.workflowStep.data.length>index){
                that.$refs.workflowStep.setCurrentRow(that.workflowStep.data[index]);
            }else{
                that.$refs.workflowStep.setCurrentRow(that.workflowStep.data[index-1]);
            }
            that.$message.success("删除成功");
        });
    }else{
        that.$alert("请选择要删除的数据");
    }
},
workflowStep_operCtrl:function(currentRow) {
    /**
    * operDisabled：控制按钮的是否禁止操作，true代表禁止操作，false代表允许操作
    * this.$set(this.stdSolReceiveHistory.operDisabled, "buttonE", true);
    * operVisible：控制按钮是否显示，true代表显示，false代表不显示
    * this.$set(this.stdSolReceiveHistory.operVisible, "buttonE", false);
    */
    if(!currentRow) {
       
    }else {
       
    }
},
workflowStepUser_currentChange:function(currentRow){
    if(!currentRow){
        //如果没有传入值，则将当前的选中值清空
        this.$data.workflowStepUser.currentRow = this.$options.data().workflowStepUser.currentRow;
    }else{
        this.workflowStepUser.currentRow = currentRow;
    }
    this.workflowStepUser_operCtrl(currentRow);
},
wfStepUgroupEdit_dialogOk:function(){
    let that = this;
    let rs=[];
    this.wfStepUgroupEdit.rightData.forEach(function(item,index){
        let index2 = that.wfStepUgroupEdit.data.findIndex(function(item2){
            return item2.id==item;
        })
        if(index2>=0){
            rs.push(that.wfStepUgroupEdit.data[index2]);
        }
    });
    this.wfStepUgroupEdit.callback(rs);
},
wfFields_change:function(fieldName,row){
    HttpApi.updateProvider("autocodeWfFields",fieldName,row,function(){
                        
    });
},
workflowStepActions_defaultAction:function() {
    let that = this;
    let wfCode = this.workflowStepActions.operData.wfCode;
    let stepCode = this.workflowStepActions.operData.stepCode;

    if (!wfCode || wfCode == '') {
        return;
    }
    
    console.log(this.workflowStepActions.operData);

    HttpApi.postConfirm("/platform/workflow/defaultAction", this.workflowStepActions.operData, function(res) {
        //请补充方法执行成功后要做的操作
        that.$message.success("执行成功！");
        that.workflowStepActions_load();
    })
},
wfStepActionRule_load:function(){
    let that = this;
    HttpApi.queryArray("autocodeWfStepActionRule",this.wfStepActionRule.operData,function(res){
        that.wfStepActionRule.data  = res;
        if(that.wfStepActionRule.data.length>0){
            that.$refs.wfStepActionRule.setCurrentRow(that.wfStepActionRule.data[0]);
            that.wfStepActionRule_operCtrl(that.wfStepActionRule.data[0]);
        }else{
             that.$refs.wfStepActionRule.setCurrentRow();
             that.wfStepActionRule_operCtrl();
        }
    });
},
tabChange:function(){
    /****** 此处添加方法内容 ******/
}
,
workflowStep_currentChange:function(currentRow){
    if(currentRow){
        this.workflowStep.currentNodeKey=currentRow.id;
        this.workflowStep.currentRow = currentRow;
            this.workflowStepUser.operData.wfStepId=this.workflowStep.currentRow.id;
this.workflowStepUser_load();
    this.workflowStepActions.operData.wfCode=this.workflowStep.currentRow.wfCode;
    this.workflowStepActions.operData.stepCode=this.workflowStep.currentRow.stepCode;
this.workflowStepActions_load();

    }else{
        this.$data.workflowStep.currentNodeKey=this.$options.data().workflowStep.currentNodeKey;
        this.$data.workflowStep.currentRow = this.$options.data().workflowStep.currentRow;
        this.$data.workflowStepUser.operData=this.$options.data().workflowStepUser.operData;
this.$data.workflowStepUser.data=this.$options.data().workflowStepUser.data;
this.$data.workflowStepActions.operData=this.$options.data().workflowStepActions.operData;
this.$data.workflowStepActions.data=this.$options.data().workflowStepActions.data;
this.$data.wfStepActionRule.operData=this.$options.data().wfStepActionRule.operData;
this.$data.wfStepActionRule.data=this.$options.data().wfStepActionRule.data;

    }
    this.workflowStep_operCtrl(currentRow);
},
workflow_delete: function(){
    let that = this;
    let id=this.workflow.currentRow.id;
    if(id){
        HttpApi.delProviderConfirm("autocodeWf", this.workflow.currentRow,function(res){
            let index = that.workflow.data.findIndex(function(item){
                return item.id==id;
            });
            
            that.workflow.data.splice(index,1);
            if(that.workflow.data.length==0){
                that.$data.workflow.currentRow = that.$options.data().workflow.currentRow;
                that.$refs.workflow.setCurrentRow();
            }else if(that.workflow.data.length>index){
                that.$refs.workflow.setCurrentRow(that.workflow.data[index]);
            }else{
                that.$refs.workflow.setCurrentRow(that.workflow.data[index-1]);
            }
            that.$message.success("删除成功");
        });
    }else{
        that.$alert("请选择要删除的数据");
    }
},
wfStepUgroupEdit_load:function() {
    let that = this;
    HttpApi.post2("/platform/workflow/organUgroup", this.wfStepUgroupEdit.operData, function(res) {
        that.wfStepUgroupEdit.data = res;
    });

    this.wfStepUgroupEdit.operData.auditType = "ugroup";
    HttpApi.queryArray("autocodeWfStepUsers", this.wfStepUgroupEdit.operData, function(res) {
        that.wfStepUgroupEdit.rightData = [];
        res.forEach(function(item) {
            that.wfStepUgroupEdit.rightData.push(item.roleId);
        });

    });
},
workflowStepUserEdit_dialogOk:function(){
    let that = this;
    let rs=[];
    this.workflowStepUserEdit.rightData.forEach(function(item,index){
        let index2 = that.workflowStepUserEdit.data.findIndex(function(item2){
            return item2.username==item;
        })
        rs.push(that.workflowStepUserEdit.data[index2]);
    });
    this.workflowStepUserEdit.callback(rs);
},
workflow_editWorkflowAdd:function() {
    let that = this;
    this.workflowAdd.editorForm = true;
    if (!this.workflow.currentRow.id) {
        this.$alert("请先选中一条工作流信息");
        return;
    } else {
        this.workflowAdd_dialogOpen(this.workflow.currentRow, function(dialogData) {
            HttpApi.saveProvider("autocodeWf", dialogData, function(res) {
                let index = that.workflow.data.findIndex(function(item) {
                    return item.id == res.id;
                });
                that.$set(that.workflow.data, index, res);
                that.$refs.workflow.setCurrentRow(res);
                that.$message.success("操作成功！");
                that.workflowAdd.visible = false;
            });
        })
    }
},
wfStepUgroupEdit_dialogCancel:function(){
     this.wfStepUgroupEdit.visible = false;
},
workflowActionAdd_dialogOpen:function(param,callback){
    this.$data.workflowActionAdd.data = this.$options.data().workflowActionAdd.data;
    this.$data.workflowActionAdd.operData = this.$options.data().workflowActionAdd.operData;
    for(let val in param) {
        this.$set(this.workflowActionAdd.data, val, param[val])
    }
    this.workflowActionAdd.callback=callback;
    this.workflowActionAdd.visible = true;
}
,
workflow_openWorkflowAdd:function() {
    let that = this;
    this.workflowAdd.editorForm = false;
    let param = {};

    this.workflowAdd_dialogOpen(param, function(dialogData) {
        HttpApi.saveProvider("autocodeWf", dialogData, function(res) {
            that.workflow.data.push(res);
            that.$refs.workflow.setCurrentRow(res);
            that.workflowAdd.visible = false;
        });
    })
},
wfActionRuleDetail_change:function(fieldName,row){
    HttpApi.updateProvider("autocodeWfRuleDetail",fieldName,row,function(){
                        
    });
},
workflowStepAdd_load:function(){
    let that = this;
    HttpApi.queryObject("autocodeWfStep",this.workflowStepAdd.operData,function(res){
        that.workflowStepAdd.data = res;
    });
},
wfFieldAdd_dialogOpen:function(param,callback){
    this.$data.wfFieldAdd.data = this.$options.data().wfFieldAdd.data;
    this.$data.wfFieldAdd.operData = this.$options.data().wfFieldAdd.operData;
    for(let val in param) {
        this.$set(this.wfFieldAdd.data, val, param[val])
    }
    this.wfFieldAdd.callback=callback;
    this.wfFieldAdd.visible = true;
}
,
workflowAdd_load:function(){
    let that = this;
    HttpApi.queryObject("autocodeWf",this.workflowAdd.operData,function(res){
        that.workflowAdd.data = res;
    });
},
wfStepRoleEdit_dialogOpen:function(param,callback){
    this.$data.wfStepRoleEdit.data = this.$options.data().wfStepRoleEdit.data;
    this.$data.wfStepRoleEdit.rightData = this.$options.data().wfStepRoleEdit.rightData;
    this.$data.wfStepRoleEdit.operData = this.$options.data().wfStepRoleEdit.operData;
    for(let val in param) {
        this.$set(this.wfStepRoleEdit.operData, val, param[val])
    }
    this.wfStepRoleEdit.callback=callback;
    this.wfStepRoleEdit.visible = true;
    this.wfStepRoleEdit_load();
}
,
wfStepActionRule_openWfActionRuleAdd:function(){
    let that = this;
    if (!this.workflowStepActions.currentRow.id) {
        this.$alert("请先选中一条执行操作信息");
        return;
    }else{
        this.wfActionRuleAdd.editorForm = false;
        let param = {};
        param.actionId=this.wfStepActionRule.operData.actionId;

        this.wfActionRuleAdd_dialogOpen(param,function(dialogData){
            HttpApi.saveProvider("autocodeWfStepActionRule",dialogData,function(res){
                that.$message.success("操作成功！");
                that.wfStepActionRule.data.push(res);
                that.$refs.wfStepActionRule.setCurrentRow(res);
                that.wfActionRuleAdd.visible = false;
            });
        })
    
    }
},
workflowActionAdd_load:function(){
    let that = this;
    HttpApi.queryObject("autocodeWfStepActions",this.workflowActionAdd.operData,function(res){
        that.workflowActionAdd.data = res;
    });
},
workflowStepUserEdit_load:function() {
    let that = this;
    console.log(this.workflowStepUserEdit.operData);
    HttpApi.post("/platform/workflow/organUser", this.workflowStepUserEdit.operData, function(res) {
        console.log(res);
        res.forEach(function(item) {
            item.label = item.fullname + "【" + item.username + "】"
        });
        that.workflowStepUserEdit.data = res;
    });

    this.workflowStepUserEdit.operData.auditType = "user";
    HttpApi.queryArray("autocodeWfStepUsers", this.workflowStepUserEdit.operData, function(res) {
        that.workflowStepUserEdit.rightData = [];
        res.forEach(function(item) {
            that.workflowStepUserEdit.rightData.push(item.username);
        });

    });
},
workflowStepUserEdit_dialogCancel:function(){
     this.workflowStepUserEdit.visible = false;
},
workflowStepUser_editWfStepRoleEdit:function() {
    /*没有定义方法模板，需要去定义方法模板*/
    let that = this;
    this.wfStepRoleEdit_dialogOpen(this.workflowStepUser.operData, function(dialogData) {
        let rs = {};
        rs.wfStepId = that.workflowStepUser.operData.wfStepId;
        rs.roles = dialogData;
        HttpApi.post("/platform/workflow/saveWfStepRole", rs, function(res) {
            that.workflowStepUser_load();
            that.wfStepRoleEdit.visible = false;
        });

    })
},
workflowStepActions_load:function(){
    let that = this;
    HttpApi.queryArray("autocodeWfStepActions",this.workflowStepActions.operData,function(res){
        that.workflowStepActions.data  = res;
        if(that.workflowStepActions.data.length>0){
            that.$refs.workflowStepActions.setCurrentRow(that.workflowStepActions.data[0]);
            that.workflowStepActions_operCtrl(that.workflowStepActions.data[0]);
        }else{
             that.$refs.workflowStepActions.setCurrentRow();
             that.workflowStepActions_operCtrl();
        }
    });
},
workflowStepActions_operCtrl:function(currentRow) {
    /**
    * operDisabled：控制按钮的是否禁止操作，true代表禁止操作，false代表允许操作
    * this.$set(this.stdSolReceiveHistory.operDisabled, "buttonE", true);
    * operVisible：控制按钮是否显示，true代表显示，false代表不显示
    * this.$set(this.stdSolReceiveHistory.operVisible, "buttonE", false);
    */
    if(!currentRow) {
       
    }else {
       
    }
},
workflow_change:function(fieldName,row){
    HttpApi.updateProvider("autocodeWf",fieldName,row,function(){
                        
    });
},
workflowStepAdd_change:function(fieldName){
    HttpApi.updateProvider("autocodeWfStep",fieldName,this.workflowStepAdd.data,function(){

    });
},
wfFields_dialogOk:function(){
      let that = this;
      let selection = that.$refs.wfFields.selection;
      let selLength = selection.length;
      if(selLength==0){
          that.$alert("请至少选择一条数据!");
          return;
      }else{
          this.wfFields.callback(selection);
      }
},
workflowStepUser_change:function(fieldName,row){
    HttpApi.updateProvider("autocodeWfStepUsers",fieldName,row,function(){
                        
    });
},
wfStepRoleEdit_dialogOk:function(){
    let that = this;
    let rs=[];
    this.wfStepRoleEdit.rightData.forEach(function(item,index){
        let index2 = that.wfStepRoleEdit.data.findIndex(function(item2){
            return item2.id==item;
        })
        if(index2>=0){
            rs.push(that.wfStepRoleEdit.data[index2]);
        }
    });
    this.wfStepRoleEdit.callback(rs);
},
wfRuleDetailAdd_dialogOk:function(){
    let that = this;
    this.$refs.wfRuleDetailAdd.validate(function(valid){
        if(valid){
            that.wfRuleDetailAdd.callback(that.wfRuleDetailAdd.data);
        }else{
            return false;
        }
    });
},
workflowAdd_dialogOpen:function(param,callback){
    this.$data.workflowAdd.data = this.$options.data().workflowAdd.data;
    this.$data.workflowAdd.operData = this.$options.data().workflowAdd.operData;
    for(let val in param) {
        this.$set(this.workflowAdd.data, val, param[val])
    }
    this.workflowAdd.callback=callback;
    this.workflowAdd.visible = true;
}
,
wfStepActionRule_editWfActionRuleAdd:function(){
    let that = this;
    this.wfActionRuleAdd.editorForm = true;
    if(!this.wfStepActionRule.currentRow.id){
        this.$alert("请先选中一条操作规则信息");
        return;
    }else{
        this.wfActionRuleAdd_dialogOpen(this.wfStepActionRule.currentRow,function(dialogData){
            HttpApi.saveProvider("autocodeWfStepActionRule",dialogData,function(res){
                let index = that.wfStepActionRule.data.findIndex(function(item){
                    return item.id==res.id;
                });
                that.$set(that.wfStepActionRule.data, index, res);
                that.$refs.wfStepActionRule.setCurrentRow(res);
                that.$message.success("操作成功！");
                that.wfActionRuleAdd.visible = false;
            });
        })
    }
},
wfFields_operCtrl:function(currentRow) {
    /**
    * operDisabled：控制按钮的是否禁止操作，true代表禁止操作，false代表允许操作
    * this.$set(this.wfFields.operDisabled, "buttonE", true);
    * operVisible：控制按钮是否显示，true代表显示，false代表不显示
    * this.$set(this.wfFields.operVisible, "buttonE", false);
    */
    if(!currentRow) {
       
    }else {
       
    }
},
workflowStepActions_currentChange:function(currentRow){
    if(currentRow){
        this.workflowStepActions.currentNodeKey=currentRow.id;
        this.workflowStepActions.currentRow = currentRow;
            this.wfStepActionRule.operData.actionId=this.workflowStepActions.currentRow.id;
this.wfStepActionRule_load();

    }else{
        this.$data.workflowStepActions.currentNodeKey=this.$options.data().workflowStepActions.currentNodeKey;
        this.$data.workflowStepActions.currentRow = this.$options.data().workflowStepActions.currentRow;
        this.$data.wfStepActionRule.operData=this.$options.data().wfStepActionRule.operData;
this.$data.wfStepActionRule.data=this.$options.data().wfStepActionRule.data;

    }
    this.workflowStepActions_operCtrl(currentRow);
},
workflowStep_editWorkflowStepAdd:function() {
    let that = this;
    this.workflowStepAdd.editorForm = true;
    if (!this.workflowStep.currentRow.id) {
        this.$alert("请先选中一条工作流步骤信息");
        return;
    } else {
        this.workflowStepAdd_dialogOpen(this.workflowStep.currentRow, function(dialogData) {
            HttpApi.post("/platform/workflow/saveWfStep", dialogData, function(res) {
                let index = that.workflowStep.data.findIndex(function(item) {
                    return item.id == res.id;
                });
                that.$set(that.workflowStep.data, index, res);
                that.$refs.workflowStep.setCurrentRow(res);
                that.workflowStepAdd.visible = false;
            });
        })
    }
},
wfActionRuleDetail_openWfRuleDetailAdd:function() {
    let that = this;
    this.wfRuleDetailAdd.editorForm = false;
    let param = {};
    param.ruleId = this.wfActionRuleDetail.operData.ruleId;

    this.wfRuleDetailAdd_dialogOpen(param, function(dialogData) {
        HttpApi.saveProvider("autocodeWfRuleDetail", dialogData, function(res) {
            that.$message.success("操作成功！");
            that.wfActionRuleDetail.data.push(res);
            that.$refs.wfActionRuleDetail.setCurrentRow(res);
            that.wfRuleDetailAdd.visible = false;
        });
    })
},
wfActionRuleDetail_delete: function(){
    let that = this;
    let id=this.wfActionRuleDetail.currentRow.id;
    if(id){
        HttpApi.delProviderConfirm("autocodeWfRuleDetail", this.wfActionRuleDetail.currentRow,function(res){
            let index = that.wfActionRuleDetail.data.findIndex(function(item){
                return item.id==id;
            });
            
            that.wfActionRuleDetail.data.splice(index,1);
            if(that.wfActionRuleDetail.data.length==0){
                that.$data.wfActionRuleDetail.currentRow = that.$options.data().wfActionRuleDetail.currentRow;
                that.$refs.wfActionRuleDetail.setCurrentRow();
            }else if(that.wfActionRuleDetail.data.length>index){
                that.$refs.wfActionRuleDetail.setCurrentRow(that.wfActionRuleDetail.data[index]);
            }else{
                that.$refs.wfActionRuleDetail.setCurrentRow(that.wfActionRuleDetail.data[index-1]);
            }
            that.$message.success("删除成功");
        });
    }else{
        that.$alert("请选择要删除的数据");
    }
},
wfFieldAdd_load:function(){
    let that = this;
    HttpApi.queryObject("autocodeWfFields",this.wfFieldAdd.operData,function(res){
        that.wfFieldAdd.data = res;
    });
},
workflowStepActions_change:function(fieldName,row){
    HttpApi.updateProvider("autocodeWfStepActions",fieldName,row,function(){
                        
    });
},
wfActionRuleDetail_editWfRuleDetailAdd:function(){
    let that = this;
    this.wfRuleDetailAdd.editorForm = true;
    if(!this.wfActionRuleDetail.currentRow.id){
        this.$alert("请先选中一条规则详情信息");
        return;
    }else{
        this.wfRuleDetailAdd_dialogOpen(this.wfActionRuleDetail.currentRow,function(dialogData){
            HttpApi.saveProvider("autocodeWfRuleDetail",dialogData,function(res){
                let index = that.wfActionRuleDetail.data.findIndex(function(item){
                    return item.id==res.id;
                });
                that.$set(that.wfActionRuleDetail.data, index, res);
                that.$refs.wfActionRuleDetail.setCurrentRow(res);
                that.$message.success("操作成功！");
                that.wfRuleDetailAdd.visible = false;
            });
        })
    }
},
workflow_load:function(){
    let that = this;
    HttpApi.queryArray("autocodeWf",this.workflow.operData,function(res){
        that.workflow.data  = res;
        if(that.workflow.data.length>0){
            that.$refs.workflow.setCurrentRow(that.workflow.data[0]);
            that.workflow_operCtrl(that.workflow.data[0]);
        }else{
             that.$refs.workflow.setCurrentRow();
             that.workflow_operCtrl();
        }
    });
},
wfStepRoleEdit_load:function() {
    let that = this;
    HttpApi.post2("/platform/workflow/organRole", this.wfStepRoleEdit.operData, function(res) {
        that.wfStepRoleEdit.data = res;
    });

    this.wfStepRoleEdit.operData.auditType = "role";
    HttpApi.queryArray("autocodeWfStepUsers", this.wfStepRoleEdit.operData, function(res) {
        that.wfStepRoleEdit.rightData = [];
        res.forEach(function(item) {
            that.wfStepRoleEdit.rightData.push(item.roleId);
        });

    });
},
wfStepActionRule_change:function(fieldName,row){
    HttpApi.updateProvider("autocodeWfStepActionRule",fieldName,row,function(){
                        
    });
},
workflowStepUserEdit_dialogOpen:function(param,callback){
    this.$data.workflowStepUserEdit.data = this.$options.data().workflowStepUserEdit.data;
    this.$data.workflowStepUserEdit.operData = this.$options.data().workflowStepUserEdit.operData;
    for(let val in param) {
        this.$set(this.workflowStepUserEdit.operData, val, param[val])
    }
    this.workflowStepUserEdit.callback=callback;
    this.workflowStepUserEdit.visible = true;
    this.workflowStepUserEdit_load();
}
,
workflowStepAdd_dialogCancel:function(){
     this.workflowStepAdd.visible = false;
},
wfActionRuleAdd_change:function(fieldName){
    HttpApi.updateProvider("autocodeWfStepActionRule",fieldName,this.wfActionRuleAdd.data,function(){

    });
},
workflowStepUser_load:function() {
    let that = this;
    HttpApi.queryArray("autocodeWfStepUsers", this.workflowStepUser.operData, function(res) {
         that.workflowStepUser.data = res;
         if (that.workflowStepUser.data.length > 0) {
             that.$refs.workflowStepUser.setCurrentRow(that.workflowStepUser.data[0]);
             that.workflowStepUser_operCtrl(that.workflowStepUser.data[0]);
         } else {
             that.$refs.workflowStepUser.setCurrentRow();
             that.workflowStepUser_operCtrl();
         }
     });
},
wfFieldAdd_change:function(fieldName){
    HttpApi.updateProvider("autocodeWfFields",fieldName,this.wfFieldAdd.data,function(){

    });
},
workflow_editWfFields:function(){
    let that = this;
    let id=this.workflow.currentRow.id;
    if(id){
        let param = {};
        param.wfId=this.workflow.currentRow.id;

        this.wfFields_dialogOpen(param,function(dialogData){
           that.wfFields.visible = false;
        })
    }else{
        that.$alert("请选择一条主数据");
    }
},
wfStepActionRule_editWfActionRuleDetail:function(){
    let that = this;
    let id=this.wfStepActionRule.currentRow.id;
    if(id){
        let param = {};
        param.ruleId=this.wfStepActionRule.currentRow.id;

        this.wfActionRuleDetail_dialogOpen(param,function(dialogData){
           that.wfActionRuleDetail.visible = false;
        })
    }else{
        that.$alert("请选择一条主数据");
    }
},
wfStepUgroupEdit_dialogOpen:function(param,callback){
    this.$data.wfStepUgroupEdit.data = this.$options.data().wfStepUgroupEdit.data;
    this.$data.wfStepUgroupEdit.rightData = this.$options.data().wfStepUgroupEdit.rightData;
    this.$data.wfStepUgroupEdit.operData = this.$options.data().wfStepUgroupEdit.operData;
    for(let val in param) {
        this.$set(this.wfStepUgroupEdit.operData, val, param[val])
    }
    this.wfStepUgroupEdit.callback=callback;
    this.wfStepUgroupEdit.visible = true;
    this.wfStepUgroupEdit_load();
}
,
workflowStepUser_editWfStepUgroupEdit:function() {
    /*没有定义方法模板，需要去定义方法模板*/
    let that = this;
    this.wfStepUgroupEdit_dialogOpen(this.workflowStepUser.operData, function(dialogData) {
        let rs = {};
        rs.wfStepId = that.workflowStepUser.operData.wfStepId;
        rs.groups = dialogData;
        HttpApi.post("/platform/workflow/saveWfStepUgroup", rs, function(res) {
            that.workflowStepUser_load();
            that.wfStepUgroupEdit.visible = false;
        });
    })
},
wfStepActionRule_delete: function(){
    let that = this;
    let id=this.wfStepActionRule.currentRow.id;
    if(id){
        HttpApi.delProviderConfirm("autocodeWfStepActionRule", this.wfStepActionRule.currentRow,function(res){
            let index = that.wfStepActionRule.data.findIndex(function(item){
                return item.id==id;
            });
            
            that.wfStepActionRule.data.splice(index,1);
            if(that.wfStepActionRule.data.length==0){
                that.$data.wfStepActionRule.currentRow = that.$options.data().wfStepActionRule.currentRow;
                that.$refs.wfStepActionRule.setCurrentRow();
            }else if(that.wfStepActionRule.data.length>index){
                that.$refs.wfStepActionRule.setCurrentRow(that.wfStepActionRule.data[index]);
            }else{
                that.$refs.wfStepActionRule.setCurrentRow(that.wfStepActionRule.data[index-1]);
            }
            that.$message.success("删除成功");
        });
    }else{
        that.$alert("请选择要删除的数据");
    }
},
wfStepUgroupEdit_operCtrl:function() {
     /**
    * operDisabled：控制按钮的是否禁止操作，true代表禁止操作，false代表允许操作
    * this.$set(this.wfStepUgroupEdit.operDisabled, "buttonE", true);
    * operVisible：控制按钮是否显示，true代表显示，false代表不显示
    * this.$set(this.wfStepUgroupEdit.operVisible, "buttonE", false);
    */
    
},
workflowStepAdd_dialogOk:function(){
    let that = this;
    this.$refs.workflowStepAdd.validate(function(valid){
        if(valid){
            that.workflowStepAdd.callback(that.workflowStepAdd.data);
        }else{
            return false;
        }
    });
},
wfActionRuleDetail_load:function(){
    let that = this;
    HttpApi.queryArray("autocodeWfRuleDetail",this.wfActionRuleDetail.operData,function(res){
        that.wfActionRuleDetail.data  = res;
        if(that.wfActionRuleDetail.data.length>0){
            that.$refs.wfActionRuleDetail.setCurrentRow(that.wfActionRuleDetail.data[0]);
            that.wfActionRuleDetail_operCtrl(that.wfActionRuleDetail.data[0]);
        }else{
             that.$refs.wfActionRuleDetail.setCurrentRow();
             that.wfActionRuleDetail_operCtrl();
        }
    });
},
wfActionRuleDetail_dialogCancel:function(){
     this.wfActionRuleDetail.visible = false;
},
workflowStepAdd_dialogOpen:function(param,callback){
    this.$data.workflowStepAdd.data = this.$options.data().workflowStepAdd.data;
    this.$data.workflowStepAdd.operData = this.$options.data().workflowStepAdd.operData;
    for(let val in param) {
        this.$set(this.workflowStepAdd.data, val, param[val])
    }
    this.workflowStepAdd.callback=callback;
    this.workflowStepAdd.visible = true;
}
,
workflowAdd_change:function(fieldName){
    HttpApi.updateProvider("autocodeWf",fieldName,this.workflowAdd.data,function(){

    });
},
workflowActionAdd_change:function(fieldName){
    HttpApi.updateProvider("autocodeWfStepActions",fieldName,this.workflowActionAdd.data,function(){

    });
},
wfActionRuleAdd_load:function(){
    let that = this;
    HttpApi.queryObject("autocodeWfStepActionRule",this.wfActionRuleAdd.operData,function(res){
        that.wfActionRuleAdd.data = res;
    });
},
wfFields_delete:function() {
    let that = this;
    let selection = that.$refs.wfFields.selection;
    let selLength = selection.length;
    if (selLength == 0) {
        that.$alert("请勾选要操作的数据");
        return;
    }
    HttpApi.delBatchProviderConfirm("autocodeWfFields", selection, function(res) {
        for (let i = 0; i < selLength; i++) {
            let index = that.wfFields.data.findIndex(function(item) {
                return item.id == selection[i].id;
            });
            that.wfFields.data.splice(index, 1);
        }

        if (that.wfFields.data.length == 0) {
            that.$data.wfFields.currentRow = that.$options.data().wfFields.currentRow;
            that.$refs.wfFields.setCurrentRow();
        } else {
            that.$refs.wfFields.setCurrentRow(that.wfFields.data[0]);
        }
        that.$message.success("删除成功");
    });
},
workflowActionAdd_dialogCancel:function(){
     this.workflowActionAdd.visible = false;
},
wfStepRoleEdit_dialogCancel:function(){
     this.wfStepRoleEdit.visible = false;
},
wfActionRuleAdd_dialogOk:function(){
    let that = this;
    this.$refs.wfActionRuleAdd.validate(function(valid){
        if(valid){
            that.wfActionRuleAdd.callback(that.wfActionRuleAdd.data);
        }else{
            return false;
        }
    });
},
wfFieldAdd_dialogOk:function(){
    let that = this;
    this.$refs.wfFieldAdd.validate(function(valid){
        if(valid){
            that.wfFieldAdd.callback(that.wfFieldAdd.data);
        }else{
            return false;
        }
    });
},
wfFields_load:function(){
    let that = this;
    HttpApi.queryArray("autocodeWfFields",this.wfFields.operData,function(res){
        that.wfFields.data  = res;
        if(that.wfFields.data.length>0){
            that.$refs.wfFields.setCurrentRow(that.wfFields.data[0]);
            that.wfFields_operCtrl(that.wfFields.data[0]);
        }else{
             that.$refs.wfFields.setCurrentRow();
             that.wfFields_operCtrl();
        }
    });
},
workflowStepUser_delete: function(){
    let that = this;
    let id=this.workflowStepUser.currentRow.id;
    if(id){
        HttpApi.delProviderConfirm("autocodeWfStepUsers", this.workflowStepUser.currentRow,function(res){
            let index = that.workflowStepUser.data.findIndex(function(item){
                return item.id==id;
            });
            
            that.workflowStepUser.data.splice(index,1);
            if(that.workflowStepUser.data.length==0){
                that.$data.workflowStepUser.currentRow = that.$options.data().workflowStepUser.currentRow;
                that.$refs.workflowStepUser.setCurrentRow();
            }else if(that.workflowStepUser.data.length>index){
                that.$refs.workflowStepUser.setCurrentRow(that.workflowStepUser.data[index]);
            }else{
                that.$refs.workflowStepUser.setCurrentRow(that.workflowStepUser.data[index-1]);
            }
            that.$message.success("删除成功");
        });
    }else{
        that.$alert("请选择要删除的数据");
    }
},
workflowStep_openWorkflowStepAdd:function(){
    let that = this;
    if (!this.workflow.currentRow.id) {
        this.$alert("请先选中一条工作流信息");
        return;
    }else{
        this.workflowStepAdd.editorForm = false;
        let param = {};
        param.wfCode=this.workflowStep.operData.wfCode;
param.wfId=this.workflowStep.operData.wfId;

        this.workflowStepAdd_dialogOpen(param,function(dialogData){
            HttpApi.saveProvider("autocodeWfStep",dialogData,function(res){
                that.$message.success("操作成功！");
                that.workflowStep.data.push(res);
                that.$refs.workflowStep.setCurrentRow(res);
                that.workflowStepAdd.visible = false;
            });
        })
    
    }
},
workflowStepActions_openWorkflowActionAdd:function(){
    let that = this;
    if (!this.workflowStep.currentRow.id) {
        this.$alert("请先选中一条工作流步骤信息");
        return;
    }else{
        this.workflowActionAdd.editorForm = false;
        let param = {};
        param.wfCode=this.workflowStepActions.operData.wfCode;
param.stepCode=this.workflowStepActions.operData.stepCode;

        this.workflowActionAdd_dialogOpen(param,function(dialogData){
            HttpApi.saveProvider("autocodeWfStepActions",dialogData,function(res){
                that.$message.success("操作成功！");
                that.workflowStepActions.data.push(res);
                that.$refs.workflowStepActions.setCurrentRow(res);
                that.workflowActionAdd.visible = false;
            });
        })
    
    }
},
wfRuleDetailAdd_dialogOpen:function(param,callback){
    this.$data.wfRuleDetailAdd.data = this.$options.data().wfRuleDetailAdd.data;
    this.$data.wfRuleDetailAdd.operData = this.$options.data().wfRuleDetailAdd.operData;
    for(let val in param) {
        this.$set(this.wfRuleDetailAdd.data, val, param[val])
    }
    this.wfRuleDetailAdd.callback=callback;
    this.wfRuleDetailAdd.visible = true;
}
,
workflowStepUser_editWorkflowStepUserEdit:function() {
    let that = this;
    this.workflowStepUserEdit_dialogOpen(this.workflowStepUser.operData, function(dialogData) {
        let rs = {};
        rs.wfStepId = that.workflowStepUser.operData.wfStepId;
        rs.users = dialogData;
        HttpApi.post("/platform/workflow/saveWfStepUser", rs, function(res) {
            that.workflowStepUser_load();
            that.workflowStepUserEdit.visible = false;
        });
    })
},
wfActionRuleAdd_dialogOpen:function(param,callback){
    this.$data.wfActionRuleAdd.data = this.$options.data().wfActionRuleAdd.data;
    this.$data.wfActionRuleAdd.operData = this.$options.data().wfActionRuleAdd.operData;
    for(let val in param) {
        this.$set(this.wfActionRuleAdd.data, val, param[val])
    }
    this.wfActionRuleAdd.callback=callback;
    this.wfActionRuleAdd.visible = true;
}
,
wfStepRoleEdit_operCtrl:function() {
     /**
    * operDisabled：控制按钮的是否禁止操作，true代表禁止操作，false代表允许操作
    * this.$set(this.wfStepRoleEdit.operDisabled, "buttonE", true);
    * operVisible：控制按钮是否显示，true代表显示，false代表不显示
    * this.$set(this.wfStepRoleEdit.operVisible, "buttonE", false);
    */
    
},
workflow_operCtrl:function(currentRow) {
    /**
    * operDisabled：控制按钮的是否禁止操作，true代表禁止操作，false代表允许操作
    * this.$set(this.stdSolReceiveHistory.operDisabled, "buttonE", true);
    * operVisible：控制按钮是否显示，true代表显示，false代表不显示
    * this.$set(this.stdSolReceiveHistory.operVisible, "buttonE", false);
    */
    if(!currentRow) {
       
    }else {
       
    }
},
workflowAdd_dialogCancel:function(){
     this.workflowAdd.visible = false;
},
wfActionRuleDetail_operCtrl:function(currentRow) {
    /**
    * operDisabled：控制按钮的是否禁止操作，true代表禁止操作，false代表允许操作
    * this.$set(this.stdSolReceiveHistory.operDisabled, "buttonE", true);
    * operVisible：控制按钮是否显示，true代表显示，false代表不显示
    * this.$set(this.stdSolReceiveHistory.operVisible, "buttonE", false);
    */
    if(!currentRow) {
       
    }else {
       
    }
},
wfActionRuleDetail_dialogOk:function(){
    let that = this;
    if(!this.wfActionRuleDetail.currentRow||!this.wfActionRuleDetail.currentRow.id||this.wfActionRuleDetail.currentRow.id==''){
        this.$alert("请至少选择一条数据！");
    }else{
        this.wfActionRuleDetail.callback(this.wfActionRuleDetail.currentRow);
    }
},
workflowStepActions_delete: function(){
    let that = this;
    let id=this.workflowStepActions.currentRow.id;
    if(id){
        HttpApi.delProviderConfirm("autocodeWfStepActions", this.workflowStepActions.currentRow,function(res){
            let index = that.workflowStepActions.data.findIndex(function(item){
                return item.id==id;
            });
            
            that.workflowStepActions.data.splice(index,1);
            if(that.workflowStepActions.data.length==0){
                that.$data.workflowStepActions.currentRow = that.$options.data().workflowStepActions.currentRow;
                that.$refs.workflowStepActions.setCurrentRow();
            }else if(that.workflowStepActions.data.length>index){
                that.$refs.workflowStepActions.setCurrentRow(that.workflowStepActions.data[index]);
            }else{
                that.$refs.workflowStepActions.setCurrentRow(that.workflowStepActions.data[index-1]);
            }
            that.$message.success("删除成功");
        });
    }else{
        that.$alert("请选择要删除的数据");
    }
},
workflowStep_load:function() {
    let that = this;
    HttpApi.queryArray("autocodeWfStep", this.workflowStep.operData, function(res) {
        that.workflowStep.data = res;
        if (that.workflowStep.data.length > 0) {
            that.$refs.workflowStep.setCurrentRow(that.workflowStep.data[0]);
            that.workflowStep_operCtrl(that.workflowStep.data[0]);
        } else {
            that.$refs.workflowStep.setCurrentRow();
            that.workflowStep_operCtrl();
        }
    });
},
wfActionRuleDetail_dialogOpen:function(param,callback){
    this.$data.wfActionRuleDetail.data = this.$options.data().wfActionRuleDetail.data;
    this.$data.wfActionRuleDetail.operData = this.$options.data().wfActionRuleDetail.operData;
    this.$data.wfActionRuleDetail.currentRow = this.$options.data().wfActionRuleDetail.currentRow;
    for(let val in param) {
        this.$set(this.wfActionRuleDetail.operData, val, param[val])
    }
    this.wfActionRuleDetail.callback=callback;
    this.wfActionRuleDetail.visible = true;
    this.wfActionRuleDetail_load();
}
,
workflow_editWorkflowAdd1:function() {
    let that = this;
    this.workflowAdd.editorForm = false;
    this.workflowAdd.title = "复制工作流";
    if (!this.workflow.currentRow.id) {
        this.$alert("请先选中一条工作流信息");
        return;
    } else {
        this.workflowAdd_dialogOpen(this.workflow.currentRow, function(dialogData) {
            HttpApi.post("/platform/workflow/copy", dialogData, function(res) {
                that.workflow.data.push(res);
                that.$refs.workflow.setCurrentRow(res);
                that.$message.success("操作成功！");
                that.workflowAdd.visible = false;
            });
        })
    }
},
wfFields_dialogCancel:function(){
     this.wfFields.visible = false;
},
wfRuleDetailAdd_dialogCancel:function(){
     this.wfRuleDetailAdd.visible = false;
},
workflow_currentChange:function(currentRow){
    if(currentRow){
        this.workflow.currentNodeKey=currentRow.id;
        this.workflow.currentRow = currentRow;
            this.workflowStep.operData.wfCode=this.workflow.currentRow.wfCode;
    this.workflowStep.operData.wfId=this.workflow.currentRow.id;
this.workflowStep_load();

    }else{
        this.$data.workflow.currentNodeKey=this.$options.data().workflow.currentNodeKey;
        this.$data.workflow.currentRow = this.$options.data().workflow.currentRow;
        this.$data.workflowStep.operData=this.$options.data().workflowStep.operData;
this.$data.workflowStep.data=this.$options.data().workflowStep.data;
this.$data.workflowStepUser.operData=this.$options.data().workflowStepUser.operData;
this.$data.workflowStepUser.data=this.$options.data().workflowStepUser.data;
this.$data.workflowStepActions.operData=this.$options.data().workflowStepActions.operData;
this.$data.workflowStepActions.data=this.$options.data().workflowStepActions.data;

    }
    this.workflow_operCtrl(currentRow);
},
wfActionRuleDetail_currentChange:function(currentRow){
    if(!currentRow){
        //如果没有传入值，则将当前的选中值清空
        this.$data.wfActionRuleDetail.currentRow = this.$options.data().wfActionRuleDetail.currentRow;
    }else{
        this.wfActionRuleDetail.currentRow = currentRow;
    }
    this.wfActionRuleDetail_operCtrl(currentRow);
},
workflowActionAdd_dialogOk:function(){
    let that = this;
    this.$refs.workflowActionAdd.validate(function(valid){
        if(valid){
            that.workflowActionAdd.callback(that.workflowActionAdd.data);
        }else{
            return false;
        }
    });
},
workflowAdd_dialogOk:function(){
    let that = this;
    this.$refs.workflowAdd.validate(function(valid){
        if(valid){
            that.workflowAdd.callback(that.workflowAdd.data);
        }else{
            return false;
        }
    });
},
workflowStepUser_operCtrl:function(currentRow) {
    /**
    * operDisabled：控制按钮的是否禁止操作，true代表禁止操作，false代表允许操作
    * this.$set(this.stdSolReceiveHistory.operDisabled, "buttonE", true);
    * operVisible：控制按钮是否显示，true代表显示，false代表不显示
    * this.$set(this.stdSolReceiveHistory.operVisible, "buttonE", false);
    */
    if(!currentRow) {
       
    }else {
       
    }
},
wfFields_editWfFieldAdd:function(){
    let that = this;
    this.wfFieldAdd.editorForm = true;
    if(!this.wfFields.currentRow.id){
        this.$alert("请先选中一条表单字段信息");
        return;
    }else{
        this.wfFieldAdd_dialogOpen(this.wfFields.currentRow,function(dialogData){
            HttpApi.saveProvider("autocodeWfFields",dialogData,function(res){
                let index = that.wfFields.data.findIndex(function(item){
                    return item.id==res.id;
                });
                that.$set(that.wfFields.data, index, res);
                that.$refs.wfFields.setCurrentRow(res);
                that.$message.success("操作成功！");
                that.wfFieldAdd.visible = false;
            });
        })
    }
},
workflowStep_change:function(fieldName,row){
    HttpApi.updateProvider("autocodeWfStep",fieldName,row,function(){
                        
    });
},
wfFields_dialogOpen:function(param,callback){
    this.$data.wfFields.data = this.$options.data().wfFields.data;
    this.$data.wfFields.operData = this.$options.data().wfFields.operData;
    this.$data.wfFields.currentRow = this.$options.data().wfFields.currentRow;
    for(let val in param) {
        this.$set(this.wfFields.operData, val, param[val])
    }
    this.wfFields.callback=callback;
    this.wfFields.visible = true;
    this.wfFields_load();
}
,
wfFields_currentChange:function(currentRow){
    if(currentRow){
        this.wfFields.currentNodeKey=currentRow.id;
        this.wfFields.currentRow = currentRow;
    }else{
        this.$data.wfFields.currentNodeKey=this.$options.data().wfFields.currentNodeKey;
        this.$data.wfFields.currentRow = this.$options.data().wfFields.currentRow;
    }
    this.wfFields_operCtrl(currentRow);
},
wfStepActionRule_currentChange:function(currentRow){
    if(!currentRow){
        //如果没有传入值，则将当前的选中值清空
        this.$data.wfStepActionRule.currentRow = this.$options.data().wfStepActionRule.currentRow;
    }else{
        this.wfStepActionRule.currentRow = currentRow;
    }
    this.wfStepActionRule_operCtrl(currentRow);
},
wfFieldAdd_dialogCancel:function(){
     this.wfFieldAdd.visible = false;
},
wfFields_openWfFieldAdd:function(){
    let that = this;
    this.wfFieldAdd.editorForm = false;
    let param = {};
    this.wfFieldAdd_dialogOpen(param,function(dialogData){
       
        HttpApi.saveProvider("autocodeWfFields",dialogData,function(res){
            that.$message.success("操作成功！");
            that.wfFields.data.push(res);
            that.$refs.wfFields.setCurrentRow(res);
            that.wfFieldAdd.visible = false;
        });
    })
}
},
            mounted: function(){
    dragControllerLR();
    dragControllerUD();
},
            created: function(){
    let that=this;
    //获取字典信息
    HttpApi.dictOptions(["fieldType"],function(res){
        that.dictOptions=res;
    });

    //加载自定义数据字典
    HttpApi.customOptions("organDict",{},function(res){
    that.$set(that.customOptions, "organDict", res);
});
HttpApi.customOptions("wfAuthType",{},function(res){
    that.$set(that.customOptions, "wfAuthType", res);
});


    //加载初始化load
    this.workflow_load();


    //加载初始化方法
    
}
    });
    

    
</script>
</html>
